<?
date_default_timezone_set('UTC');
//print CountDown('08/14/2008');
function CountDown($date)
{
	list($m,$d,$y) = explode('/',$date);
	$event=getdate();
	$curDay=$event['mday'];
	$curMonth=$event['mon'];
	$curYear=$event['year'];
	$num_of_days=0;
	if($m>$curMonth && $y==$curYear)
	{
		for($month=$curMonth+1;$month<$m;$month++)
		{
			$num_of_days += cal_days_in_month(CAL_GREGORIAN, $month, $y);
		}
		$num_of_days += cal_days_in_month(CAL_GREGORIAN, $curMonth, $y)-$curDay + $d;
		return $num_of_days-1;
	}
	else if($m<$curMonth && $y>$curYear)
	{
		for($month=$curMonth+1;$month<$m+12;$month++)
		{
			$temp1=$month;
			$temp2=$y;
			if($month>12)
			{
				$temp1=$month%12;
				$temp2=$y+1;
			}
			$num_of_days += cal_days_in_month(CAL_GREGORIAN, $temp1, $temp2);
		}
		$num_of_days += cal_days_in_month(CAL_GREGORIAN, $curMonth, $temp2)-$curDay + $d;
		return $num_of_days-1;
	}
	else if($m==$curMonth && $y==$curYear)
	{
		return $num_of_days =$d-$curDay;
	}
	else
	{
		print "Invalid Date of Birth";
	}
		
}
?>


<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>Testning på hög nivå</title>
		<link rel="stylesheet" type="text/css" href="styles/basic.css" title="default" />
		<script src="http://code.jquery.com/jquery-latest.js"></script>
		<link href='http://fonts.googleapis.com/css?family=Shadows+Into+Light&v1' rel='stylesheet' type='text/css'>
	</head>
	<body>
		<section>
			<header>
				<h1 id="phpHeader">KLASLUNDIN.SE</h1>
			</header>
			<nav></nav>
			<div id="content">
				<p>
					<h1 id="phpHeader">Välkommen till klaslundin.se</h1>
				</p>
				<script>
					/* ===== Firefox ===== */

					// Select Firefox
					if(jQuery.browser.mozilla) {
						document.write("Du surfar med Mozilla Firefox och din skärmupplösning är: " + screen.width + "x" + screen.height);
					}

					/* ===== Internet Explorer ===== */

					// Select Internet Explorer
					if(jQuery.browser.msie) {
						document.write("Du använder Internet Explorer... Byt fort som faan! Är du intresserad är din skärmupplösning: " + screen.width + "x" + screen.height);
					}

					/* ===== Safari / Chrome ===== */

					// Select Safari / Chrome
					if(jQuery.browser.safari) {
						document.write("Du surfar med Chrome! Och din skärmupplösning är: " + screen.width + "x" + screen.height);
					}

					/* ===== Opera ===== */

					// Select Opera
					if(jQuery.browser.opera) {
						document.write("Du surfar med Opera!");
					}
				</script>
				<br/>
				<?php
				require_once 'PhpClass/cite.php';
				?>

				<?php

				$array1 = array('One' => 1, 'Two' => 2, 'Three' => 3, 'Four' => 4, 'Five' => 5);

				//REVERSE $array1 INTO $array2
				$array2 = array();
				foreach ($array1 as $key => $value) {
					$array2 = ( array($key => $value) + $array2);
				}

				echo '<pre>';
				print_r($array1);
				print_r($array2);
				echo '</pre>';
				?>
				
				</div>
				<footer>
				<p id="php">
				Dagens datum: <?php print(Date("l d F Y"));
				?>
				</p>
				</footer>
		</section>
	</body>
</html>
